﻿$(function () {
    initializeCreditRequestAsignation();
    initializeAprovalFormRequest();

});

function initializeCreditRequestAsignation() {
    var idGroupChief = $("#modal_asign_chiefid").attr("value");
    $(".link-modal-asign-credit-request").bind("click", function () {
        var idRequest = $(this).text();       
        $.ajax({
            url: "\CreditRequestAsignationModal",
            type: "post",
            data: { idRequest: parseInt(idRequest), idGroupChief: parseInt(idGroupChief) },
            dataType: "json",
            success: function (resp) {
                $(".content-inbox-modal-view").html(resp.view);
            }
        });
       
    });
}

function initializeAprovalFormRequest() {


    var idAnswer = $("#modal_approval_idapp").attr("value");
    $(".link-modal-approval-form-request").bind("click", function () {
        var idRequest = $(this).text();
        $.ajax({
            url: "\ApprovalFormModal",
            type: "post",
            data: { idAnswer: parseInt(idAnswer) },
            dataType: "json",
            success: function (resp) {
                $(".content-inbox-modal-view").html(resp.view);
            }
        });



    });
}